// 由于项目路由逐渐变多,我们将路由的配置,统一放在一个文件中 方便

const routes = [
  { path: "/", redirect: "/home" },
  { path: "/home", component: () => import("@/views/Home") },
  {
    path: "/Login",
    component: Login,
    meta: {
      // 添加路由元,在需要隐藏的组件添加ishiddenfooter:true,属性值为true是隐藏.然后在app根组件中,通过v-show来判断是否展示
      isHiddenFooter: true,
    },
  },
  {
    path: "/Register",
    component: Register,
    isHiddenFooter: true,
  },
  {
    // path: "/Search/:keyword?",
    path: "/Search/:keyword?",
    name: "Search",
    component: Search,
    meta: {
      isHiddenNav: true,
    },
  },
  // 跳转detail详情页
  {
    path: "/detail/:id",
    name: "Detail",
    // 路由懒加载
    component: () => import("@/views/Detail"),
    // 在此处规则当中添加一个props:true属性的时候，就可以在对应的组件中使用props:[]来接收
    // ????
    props: true,
    meta: {
      isHiddenNav: true,
    },
  },
]
